
/**
 * 普通的Post提交
 * @returns
 */
function login(){
	axios.post('/login',{
		username: loginFormApp.loginForm.Name,
	    password: loginFormApp.loginForm.Pwd
	  })
	  .then(function (response) {
	    console.log(response);
	  })
	  .catch(function (error) {
	    console.log(error);
	  });
}


/**
 * 表单提交
 * @returns
 */
function axiosFormSubmit(){
	console.log("axiosFormSubmit");
	
	var params = new URLSearchParams();
	params.append('username', loginFormApp.loginForm.Name);
	params.append('password', loginFormApp.loginForm.Pwd);
	
	axios.post('/login', params)
		  .then(function (response) {
		    console.log(response);
		    if(response.data.status == false){
					console.log(response.data);
					loginFormApp.alertInfo.isShow=true;
				}
				else{
					console.log(response.data);
					window.location.href="/Search.html";
				}
		  })
		  .catch(function (error) {
		    console.log(error);
		  });	
}


function logout(){
	axios.get('/logout')
	  .then(function (response) {
	    console.log(response);
	    window.location.href="/logout";
	  })
	  .catch(function (error) {
	    console.log(error);
	  });
}